package com.tarena.dang.actions.order;

import com.tarena.dang.actions.BaseAction;
import com.tarena.dang.pojos.Address;
import com.tarena.dang.services.AddressService;
import com.tarena.dang.services.impl.AddressServiceImpl;
/**
 * AJAX
 * @author skyqty
 *
 */
public class GetAddressAction extends BaseAction {
	private int aid;
	private Address address;

	public String execute() {
		AddressService service = new AddressServiceImpl();
		try {
			address = service.findAddressById(aid);
			return "success";
		} catch (Exception e) {
			e.printStackTrace();
			return "fail";
		}
	}

	public int getAid() {
		return aid;
	}

	public void setAid(int aid) {
		this.aid = aid;
	}

	public Address getAddress() {
		return address;
	}

	public void setAddress(Address address) {
		this.address = address;
	}

}
